<?php
include_once ("phpsqlajax_dbinfo.php");

// Select all the rows in the markers table
$query = "SELECT * FROM markers";
$result = mysql_query($query);
if (!$result) {
	die('Invalid query: ' . mysql_error());
}

$i = 0;

$json = array('markers' => array());

while ($row = @mysql_fetch_assoc($result))
{
	$json['markers'][$i]['id'] = $row['id'];
	$json['markers'][$i]['name'] = $row['name'];
	$json['markers'][$i]['address'] = $row['address'];
	$json['markers'][$i]['lat'] = $row['lat'];
	$json['markers'][$i]['lng'] = $row['lng'];
	$json['markers'][$i]['type'] = $row['type'];
	$json['markers'][$i]['fone'] = $row['fone'];
	$json['markers'][$i]['city'] = $row['city'];
	$json['markers'][$i]['sector'] = $row['sector'];
	$json['markers'][$i]['state'] = $row['state'];
	$json['markers'][$i]['cep'] = $row['cep'];
	$json['markers'][$i]['cost'] = $row['cost'];
	$json['markers'][$i]['payment'] = $row['payment'];
	$json['markers'][$i]['number'] = $row['number'];
	$json['markers'][$i]['image'] = $row['image'];
	$json['markers'][$i]['fk_client'] = $row['fk_client'];

	$i++;
}	

echo json_encode($json);

?>